
Ext.define('MyDesktop.module.RoleManager',{
	extend:'Ext.ux.desktop.Module',
	id:'role-manager-win',
	init:function(){
		this.launcher = {
			text:'角色管理',
			iconCls:'accordion'
		}
	},
	
	createWindow:function(){
		var desktop = this.app.getDesktop();
        var win = desktop.getWindow('role-manager-win');
        if(!win)
        {
        	win = desktop.createWindow({
        		id:'role-manager-win',
        		title:'角色管理',
        		iconCls:'icon-grid',
        		width:800,
        		height:500,
        		layout: 'fit',
        		//window items start
                items: [
                    {
                        border: false,
                        xtype: 'grid',
                        
                        //dockedItems start
                        dockedItems:[
                                     {    
                                   	 dock:'bottom',    
                                   	 xtype:'pagingtoolbar',    
                                   	 displayInfo:true,    
                                   	 store:Ext.create('A4.store.rolemanager.RoleListStore'),
                                   	 displayMsg:'显示{0}-{1}条，共计{2}条',    
                                   	 emptyMsg:'没有数据'    
                                    },
                                    
                                    {
                                        xtype: 'toolbar',
                                        items: [{
                                       	 text:'创建',
                                            tooltip:'创建',
                                            iconCls:'add',
                                            id:'role-manager-create-role'
                                        },'-',{
                                       	 text:'删除',
                                            tooltip:'删除',
                                            iconCls:'remove'
                                        },'-',{
                                       	 xtype:'textfield',
                                       	 fieldLabel:'角色名',
                                       	 labelWidth:40
                                        },
                                        {
                                       	 xtype:'button',
                                       	iconCls:'search',
                                       	 text:'查询'
                                        }]
                                    }],
                       //dockedItems end      
                       selModel: new Ext.selection.CheckboxModel,
                         
                      //columns start
                        columns: [
                            {
                                text: "角色名",
                                flex:1,
                                sortable: true,
                                dataIndex: 'roleName'
                            },
                            {
                                text: "描述",
                                width: 150,
                                sortable: true,
                                dataIndex: 'mark'
                            },
                            {
                            	id:'update-manager-update-role',
                            	text:'编辑',
                                width:70,
                                renderer:function(value, metaData, record){   
                            	   return "<img src='../extjs/shared/icons/fam/edit.png' />"; 
                            	   }  
                            }
                        ],
                        store:Ext.create('A4.store.rolemanager.RoleListStore')
                      //columns end
                    }
                ]
              //window items end
        	});
        }
        return win;
	}
});
